'use strict';

/* Filters */
angular.module('app')
    .filter('companyFilter', function () {
        return function (data) {
            var companyObj = {
                0: {
                    name: '理财'
                },
                1: {
                    name: '券商'
                },
                2: {
                    name: '课程'
                }
            };

            if (companyObj[data]) {
                return companyObj[data]['name'];
            } else {
                return '';
            }

        }
    })
    .filter('levelFilter', function () {
        return function (data) {
            var levelObj = {
                0: {
                    name: '初级'
                },
                1: {
                    name: '中级'
                },
                2: {
                    name: '高级'
                }
            };

            if (levelObj[data]) {
                return levelObj[data]['name'];
            } else {
                return '';
            }

        }
    })
    .filter('freezeFilter', function () {
        return function (data) {
            var freezeObj = {
                0: {
                    name: '冻结'
                },
                1: {
                    name: '解冻'
                }
            };

            if (freezeObj[data]) {
                return freezeObj[data]['name'];
            } else {
                return '';
            }

        }
    }).filter('sexFilter', function () {
        return function (data) {
            var freezeObj = {
                0: {
                    name: '男'
                },
                1: {
                    name: '女'
                }
            };

            if (freezeObj[data]) {
                return freezeObj[data]['name'];
            } else {
                return '';
            }

        }
    }).filter('statusFilter', function () {
        return function (data) {
            var freezeObj = {
                0: {
                    name: '失败'
                },
                1: {
                    name: '成功'
                }
            };

            if (freezeObj[data]) {
                return freezeObj[data]['name'];
            } else {
                return '';
            }

        }
    });